import Vue from 'vue'
import Router from 'vue-router'
// import HelloWorld from '@/components/HelloWorld'
import Index from '../pages/index/Index'
import Videos from '../pages/videoes/Videos'
import Friends from '../pages/friends/Friends'
import SCar from '../pages/shoppingcar/SCar'
import GCart from "../pages/shoppingcar/GCar";
import Mine from '../pages/mine/Mine'
import GDetails from "../pages/goods/GDetails";
Vue.use(Router)
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

export default new Router({
  routes: [
    {
      path: "/",
      name: "Index",
      component: Index,
      meta: {
        showTab: true
      }
    },
    {
      path: "/videos",
      name: "Videos",
      component: Videos,
      meta: {
        showTab: true
      }
    },
    {
      path: "/scar",
      name: "SCar",
      component: SCar,
      meta: {
        showTab: true
      }
    },
    {
      path: "/mine",
      name: "Mine",
      component: Mine,
      meta: {
        showTab: true
      }
    },
    {
      path: "/friends",
      name: "Friends",
      component: Friends,
      meta: {
        showTab: true
      }
    },
    {
      path: "/Index",
      redirect: "/"
    },
    {
      path: "/detail/:id",
      name: "GDetails",
      component: GDetails
    },
    {
      path: "/cart",
      name: "GCart",
      component: GCart,
      meta: {
        title: "购物车"
      }
    },
    {
      path: "*",
      redirect: "/"
    }
  ]
});
